import request from '@/utils/request'

// 记录详情
export function recordDtl(data = {}) {
  return request({
    url: '/eflow/process-instance/detail',
    method: 'get',
    params: data
  })
}
// 申请列表
export function recordList(data = {}) {
  return request({
    url: '/eflow/process-instance/page',
    method: 'post',
    data: data
  })
}
// 执行
export function execute(data = {}) {
  return request({
    url: '/eflow/process-engine/execute',
    method: 'post',
    data: data
  })
}
// 已部署的流程列表
export function defineList(data = {}) {
  return request({
    url: '/eflow/process-design/myDefines',
    method: 'post',
    data: data
  })
}

// 任务详情
export function taskDtl(data = {}) {
  return request({
    url: '/eflow/process-task/detail',
    method: 'get',
    params: data
  })
}

// 待处理任务列表
export function taskTodo(data = {}) {
  return request({
    url: '/eflow/process-task/todo',
    method: 'post',
    data
  })
}
// 待处理任务数量
export function taskTodoCount(data = {}) {
  return request({
    url: '/eflow/process-task/todoCount',
    method: 'post',
    data
  })
}

// 任务表单
export function startForm(data = {}) {
  return request({
    url: '/eflow/process-engine/startForm',
    method: 'post',
    data
  })
}

// 提交表单
export function subForm(data = {}) {
  return request({
    url: '/eflow/process-engine/start',
    method: 'post',
    data
  })
}


// 按部门统计不同类型
export function getCountByDeptAndType(data = {}) {
  return request({
    url: '/eflow/work-event/countByDeptAndType',
    method: 'get',
    params: data
  })
}


// 统计下级部门的
export function getCountDeptChildren(data = {}) {
  return request({
    url: '/eflow/work-event/countDeptChildren',
    method: 'get',
    params: data
  })
}


// 按租户成员查询自己的考勤申请数据
export function getCountByMember(data = {}) {
  return request({
    url: '/eflow/attendance/countByMember',
    method: 'get',
    params: data
  })
}


// 事件转派
export function surrogate(data = {}) {
  return request({
    url: '/eflow/process-instance/surrogate',
    method: 'post',
    data
  })
}
